//
//  userInfoModel.m
//  lTTheOne
//
//  Created by AA on 2024/3/10.
//

#import "userInfoModel.h"

@implementation userInfoModel


- (BOOL)iSnilData{
 
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:[self modelForDict]];
    
    NSNumber *user_type= [dic valueForKey:@"user_type"];
    if ([user_type isEqualToNumber:@1] || [user_type isEqualToNumber:@3]) {
        [dic removeObjectForKey:@"chest_girth"];
        [dic removeObjectForKey:@"waistline"];
    }
    for (NSString *key in dic) {
        
        id obj = [dic valueForKey:key];
        if ([obj isKindOfClass:[NSString class]]) {
            
            NSString *objStr = obj;
            if ([objStr isEqualToString:@""]) {
                return NO;
            }
        }
        else if ([obj isKindOfClass:[NSNumber class]])
        {
            NSNumber *objnum = obj;
            CGFloat value = [objnum floatValue];
            if (value <= 0) {
                return NO;
            }
        }
        else if ([obj isKindOfClass:[NSNull class]]){
            return NO;
        }
    }
    return YES;
}


@end

@implementation OneUserVipModel
- (BOOL)vipValid{
    return (_end_time>=[[NSDate date]timeIntervalSince1970]?YES:NO);
}

@end
